package sharewithus.ex.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import sharewithus.business.dto.UserExtDTO;
import sharewithus.ex.dao.IEXDAO;
import sharewithus.ex.service.EXService;
import framelib.exception.SystemException;
import framelib.mq.SpringJmsProducer;
import framelib.service.AbsService;
import framelib.utils.ClientXmemcached;

/**
 * Title:EXServiceImpl
 * Description:
 * @Create_by:Vince Yu
 * @Create_date:2012-5-4
 * @Last_Edit_By:
 * @Edit_Description
 * @version:ShareWithUs 1.0
 * 
 */
@SuppressWarnings("unchecked")
public class EXServiceImpl extends AbsService implements EXService {

	@Autowired
	@Qualifier("EXDAO")
	IEXDAO EXDAO;

	
	@Autowired
	@Qualifier("clientMemcached")
	ClientXmemcached mc;

	@Autowired
	@Qualifier("producer")
	SpringJmsProducer producer;

	/**
	 * 2011-1-18, 下午06:51:19 方法描述：测试用方法
	 * 
	 * @param id 
	 * @return
	 * @throws Exception 
	 * @throws Exception 
	 */
	public String getName(String id) throws Exception {
		//**Test Memcached**//
		mc.add("Vince2", "Vince Yu2");
		mc.get("Vince2");
		producer.send("Vince");
		try{
			EXDAO.saveTest();
		}catch (Exception e) {
			Object[] obj = new Object[1];
			obj[0] = " dddd ";
			//obj[1] = " xxxx ";
			throw new SystemException("test2",obj);
		}
		return "Vince";
	}
}
